﻿using ERPU8WebApi.App_Start;
using ERPU8WebApi.Controllers;
using ERPU8WebApi.Dal;
using ERPU8WebApi.Log;
using ERPU8WebApi.Models;
using ERPU8WebApi.Until;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace ERPU8WebApi
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            string loginResult = "";
            var log = LogFactory.GetLogger(this.GetType().ToString());
            try
            {
               loginResult= U8LoginConfig.CreateInstance().U8Login();

            }
            catch (Exception ex)
            {

                loginResult = ex.ToString();
            }
            finally {
                log.Info(loginResult);
            }
        }
    }
}
